package com.zlm.TCP;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @author 13026
 */
public class Client {
    /*
     * TCP 客户端发送数据
     * */
    public static void main(String[] args) throws IOException {
        // 创建Socket对象，创建时会链接服务端，连不上报错
        Socket socket = new Socket("127.0.0.1", 10000);
        // 从通道中获取输出流
        OutputStream os = socket.getOutputStream();
        os.write("你好你好".getBytes());
        socket.close();
    }
}
